<form nz-form [formGroup]="form">
  <nz-form-item>
    <nz-form-label [nzSpan]="6" nzFor="name" nzRequired>词名</nz-form-label>
    <nz-form-control [nzSpan]="14">
      <input nz-input formControlName="name" />
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label [nzSpan]="6" nzFor="animalType" nzRequired>种类</nz-form-label>
    <nz-form-control [nzSpan]="14">
      <nz-select formControlName="animalType" [nzAllowClear]="true">
        <nz-option *ngFor="let item of statList" [nzValue]="item.dictKey" [nzLabel]="item.dictValue"></nz-option>
      </nz-select>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label [nzSpan]="6" nzFor="description" nzRequired>描述</nz-form-label>
    <nz-form-control [nzSpan]="14">
      <textarea nz-input [nzAutosize]="{ minRows: 4, maxRows: 6 }" formControlName="description"></textarea>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label [nzSpan]="6" nzFor="content" nzRequired>百科内容</nz-form-label>
    <nz-form-control [nzSpan]="14">
      <textarea nz-input [nzAutosize]="{ minRows: 8, maxRows: 12 }" formControlName="content"></textarea>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label [nzSpan]="6" nzFor="img" nzRequired>图片</nz-form-label>
    <nz-form-control [nzSpan]="14">
      <nz-upload
        [nzAction]="uploadUrl"
        nzName="upload_file"
        nzListType="picture-card"
        [(nzFileList)]="fileList"
        [nzShowButton]="fileList.length < 1"
        [nzPreview]="handlePreview"
      >
        <div>
          <i nz-icon nzType="plus"></i>
          <div style="margin-top: 8px">上传</div>
        </div>
      </nz-upload>
      <nz-modal
        [nzVisible]="previewVisible"
        [nzContent]="modalContent"
        nzTitle="预览"
        [nzFooter]="null"
        (nzOnCancel)="previewVisible = false"
      >
        <ng-template #modalContent>
          <img [src]="previewImage" [ngStyle]="{ width: '100%', height: '100%' }" />
        </ng-template>
      </nz-modal>
    </nz-form-control>
  </nz-form-item>
</form>

<div class="modal-footer">
  <button nz-button nzType="default" (click)="close()"><i nz-icon [nzIconfont]="'pets_close'"></i>关闭</button>
  <button nz-button nzType="primary" (click)="save()"><i nz-icon [nzIconfont]="'pets_select'"></i>确认</button>
</div>
